import re


def print_log(string):
    """
    这是一个日志输出函数，string未将输出的值
    :param str:
    :return:
    """
    with open("../util/log.txt", encoding="utf-8") as fh: # 这里的路径时调用文件所在的路径
        data = fh.read()
        pat_num = "[a-zA-Z]+(\d+)"
        pat_string = "([a-zA-Z]+)\d+"
        _number=re.compile(pat_num).findall(data)
        pat_str=re.compile(pat_string).findall(data)
        # print(pat_str)
        number1=int(_number[0])+1
        print("==" * 36 + data + "==" * 36)
        print(string )
    number_str=str(number1)
    with open("../util/log.txt","w" ,encoding="utf-8") as fh:
        fh.write(pat_str[0]+number_str)
    print("--" * 36 + "此部分输出结束" + "--" * 36)